package com.firmiana.jt809.protocol.send;

import com.firmiana.jt809.entity.JT809Message;
import com.firmiana.jt809.protocol.ISendProtocol;
import com.firmiana.jt809.util.Tools;

/**
 * 从链路连接请求
 * 9001
 * @author hucl
 * @date 2020/8/26 16:33
 */
public class SubLinkConnectRequest implements ISendProtocol {

    private final String verifyCode;

    public SubLinkConnectRequest(String verifyCode) {
        this.verifyCode = verifyCode;
    }

    @Override
    public JT809Message wrap() {
        String dataBody = Tools.toHexString(Integer.parseInt(verifyCode), 4);
        return new JT809Message(0x9001, dataBody);
    }
}
